package com.group.three.service.impl.myorderimpl;

import com.github.pagehelper.PageHelper;
import com.group.three.entity.myOrder.OrderBuyerInformation;
import com.group.three.entity.myOrder.OrderLog;
import com.group.three.entity.myOrder.OrderSimpleVO;
import com.group.three.mapper.OrderBuyerMapper;
import com.group.three.service.myorderservice.OrderBuyerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Service
public class MyOrderServiceImpl implements OrderBuyerService {
    @Autowired
    private OrderBuyerMapper orderBuyerMapper;
    @Override
    public List<OrderBuyerInformation> selectBuyerOrder(String memberId, int pageNumber, int pageSize, String tag,String keywords) {
        PageHelper.startPage(pageNumber,pageSize);
        List<OrderBuyerInformation> orderBuyerInformations = orderBuyerMapper.selectBuyerOrder(memberId, pageNumber,pageSize,tag,keywords);


        return orderBuyerInformations;

    }

    @Override
    public List<OrderSimpleVO> selectBuyerOrderItem(String orderSn) {
        return orderBuyerMapper.selectBuyerOrderItem(orderSn);
    }

    @Override
    public List<OrderLog> selectBuyerOrderItemLog(String orderSn) {
        return orderBuyerMapper.selectBuyerOrderItemLog(orderSn);
    }

    @Override
    public int sureReceived(String orderSn) {
        return orderBuyerMapper.sureReceived(orderSn);
    }

    @Override
    public int cancelOrder(String orderSn, String reason) {
        return orderBuyerMapper.cancelOrder(orderSn,reason);
    }

    @Override
    public int deleteOrder(String orderSn) {
        return orderBuyerMapper.deleteOrder(orderSn);
    }
}
